package com.qbccn.bbs.controller;

import com.qbccn.bbs.service.AdminService;
import com.qbccn.bbs.vo.TableResultVo;
import javax.servlet.http.HttpServletRequest;
import javax.websocket.server.PathParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author linke
 * @date 2020/8/1 0:12
 * @description
 */
@Controller
@RequestMapping("admin")
public class AdminController {

  @Autowired
  private HttpServletRequest request;
  @Autowired
  private AdminService adminService;

  @GetMapping("articleClassSet")
  public String articleClassSet() {
    request.setAttribute("label", "articleClassSet");
    return "admin/articleClassSet";
  }

  @GetMapping("getArticleClass")
  @ResponseBody
  public TableResultVo getArticleClass(@PathParam("page") Integer page,
      @PathParam("limit") Integer size) {
    return adminService.getArticleClass(page, size);
  }

}
